%% calculateModulus
% 
% function to caclulate the phase of impedences 
%
%% Synatax
% [Modulus] = calculateModulus(PressureModulus, FlowModulus)
%
%
%
%% Description
%  This function will caclulate and the impedence modulus for 
% fourier pressure and flow harmonics that are imputed into the script.
% 
%ImpedenceModulus = Pressure(z) / Flow(z)
%

%% Arguments
%* PressureModulus                       - Double: A nx1 double of the
%                                         Pressure Phase values
%
%* FlowModulus                           - Double: A nx1 double of Flow Phase values
%
%
%
%% Returns
%
%* Modulus                              - Double: A nx1 double of impedence Phase  
%
%% Function Side Effects
%* N/A
%
%% Exceptions
%* An error is thrown if data type of input varaibles is not compatible
%  with what the function is expecting
%
%% See Also
% N/A
function [Modulus] = calculateModulus(PressureModulus, FlowModulus)

if isa(PressureModulus, 'double') ~=1
    type = class(PressureModulus);
    error(sprintf(('Pressure Data is of type %s please change to type double'), type))    
end

if isa(FlowModulus, 'double') ~=1
    type = class(FlowModulus);
    error(sprintf(('Flow Data is of type %s please change to type double'), type))
end

Modulus = PressureModulus./FlowModulus; % Pressure over Flow

end

